package cn.pcios.kindle.action;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.pcios.kindle.server.EpubQidianServerImpl;

@Controller
@RequestMapping("/view/kindle")
public class KindleAction {
	 private static final Logger logger = LoggerFactory.getLogger(KindleAction.class);    
	 
	 @Autowired
	 private EpubQidianServerImpl epubServer;
	@RequestMapping("/home")
	public String home(HttpServletRequest request) {
		request.setAttribute("epublist", epubServer.getEpubfindAll());
		return "kindle/home";
	}
	
	@RequestMapping("/home/limt/{idx}/{len}")
	public String queryLimitNameAll(HttpServletRequest request,@PathVariable("idx") int idx,@PathVariable("len") int len) {
		request.setAttribute("epublist", epubServer.queryLimitAll(idx, len));
		return "kindle/home";
	}
	
	
	
}
